﻿// 1.1.7.07. Write a program, which reads from the console two integer numbers N and K (K<N) and array of N integers.
// Find those K consecutive elements in the array, which have maximal sum.

using System;

class MaximalSumOfConsecutiveElements
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int k = int.Parse(Console.ReadLine());
        if (k > n)
        {
            n += k;
            k = n - k;
            n -= k;
        }
        else if (n == k)
        {
            // N > K
        }
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = int.Parse(Console.ReadLine());
        }
        
        int biggestSum = int.MinValue;
        int indexBeginSequence = 0;
        for (int i = 0; i <= arr.GetLength(0) - k; i++)
        {
            int currentSum = arr[i];
            for (int j = 1; j < k; j++)
            {
                currentSum += arr[i + j];
            }
            if (currentSum > biggestSum)
            {
                biggestSum = currentSum;
                indexBeginSequence = i;
            }
        }

        int[] result = new int[k];
        for (int i = 0; i < k; i++)
        {
            result[i] = arr[indexBeginSequence + i];
        }
        Console.WriteLine(string.Join(", ", result));
    }
}